.PHONY: www/screenshots/thumb wiki

svnroot = http://sgvizler.googlecode.com/svn/

wiki:
	cp trunk/$@/* $@

release/%:
	cd trunk; make sgvizler.min.js; make example
	mkdir -p $@
	cp trunk/sgvizler.min.js $@/sgvizler.js
	cp \
	trunk/sgvizler.html \
	trunk/LICENSE \
	trunk/sgvizler.chart.css \
	$@
	sed -i s!src=\"./sgvizler.js\"!src=\"$(svnroot)$@/sgvizler.js\"!g $@/sgvizler.html
	cp trunk/wiki/* wiki
	mkdir -p $@/example
	cp trunk/example/*.html $@/example
	cp trunk/example/*.css $@/example
	mkdir -p $@/lib
	cp trunk/lib/* $@/lib
	svn status

tag/%:
	svn cp trunk $@

SCREENSHOTS=$(wildcard www/screenshots/*.*)
www/screenshots/thumb: $(SCREENSHOTS)
	for image in $(SCREENSHOTS) ; do \
	convert -thumbnail 200x150 $$image $$image.thumb.jpg ; \
	done
	mv www/screenshots/*.thumb.jpg www/screenshots/thumb/